<template>
  <view :style="themeColor">
    <view class="page">
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout sourceHousing_flex_0">
        <view class='flex flex-wrap align-center'>
          <image class='sourceHousing_fd0_0_c0' mode="aspectFit" @click.stop="goUrl" :src='carousel'></image>
        </view>
        <view class='flex flex-wrap align-center sourceHousing_fd0_1' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/fafangyuan/publishingRule/publishingRule`">
          <text class='fu-iconfont2  sourceHousing_fd0_1_c0'>&#xe600;</text>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout sourceHousing_flex_1">
        <view class='flex flex-direction flex-wrap align-stretch sourceHousing_fd1_0'>
          <view class='flex flex-wrap align-center justify-between sourceHousing_fd1_0_c0' @tap.stop="handleJumpDiy"
            data-type="navigateTo"
            :data-url="`/pages/fafangyuan/releaseVariousresources/releaseVariousresources?type=1`">
            <view class='flex flex-wrap align-center'>
              <image class='sourceHousing_fd1_0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"44.png"'></image>
              <view class='flex flex-direction flex-wrap align-start'>
                <text class='sourceHousing_fd1_0_c0_c0_c1_c0'>{{$t('长租独立单位')}}</text>
                <text class='sourceHousing_fd1_0_c0_c0_c1_c1'>{{$t('租期1年或以上')}}</text>
              </view>
            </view>
            <image class='sourceHousing_fd1_0_c0_c1' mode="aspectFit" :src='STATIC_URL+"46.png"'></image>
          </view>
          <view class='flex flex-wrap align-center justify-between sourceHousing_fd1_0_c1' @tap.stop="handleJumpDiy"
            data-type="navigateTo"
            :data-url="`/pages/fafangyuan/releaseVariousresources/releaseVariousresources?type=2`">
            <view class='flex flex-wrap align-center'>
              <image class='sourceHousing_fd1_0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"49.png"'></image>
              <view class='flex flex-direction flex-wrap align-start'>
                <text class='sourceHousing_fd1_0_c0_c0_c1_c0'>{{$t('劏房/套房')}}</text>
                <text class='sourceHousing_fd1_0_c0_c0_c1_c1'>{{$t('任何租期：包括短租及长租')}}</text>
              </view>
            </view>
            <image class='sourceHousing_fd1_0_c0_c1' mode="aspectFit" :src='STATIC_URL+"46.png"'></image>
          </view>
          <view class='flex flex-wrap align-center justify-between sourceHousing_fd1_0_c1' @tap.stop="handleJumpDiy"
            data-type="navigateTo"
            :data-url="`/pages/fafangyuan/releaseVariousresources/releaseVariousresources?type=3`">
            <view class='flex flex-wrap align-center'>
              <image class='sourceHousing_fd1_0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"48.png"'></image>
              <view class='flex flex-direction flex-wrap align-start'>
                <text class='sourceHousing_fd1_0_c0_c0_c1_c0'>{{$t('短租独立单位')}}</text>
                <text class='sourceHousing_fd1_0_c0_c0_c1_c1'>{{$t('租期1年以内')}}</text>
              </view>
            </view>
            <image class='sourceHousing_fd1_0_c0_c1' mode="aspectFit" :src='STATIC_URL+"46.png"'></image>
          </view>
          <view class='flex flex-wrap align-center justify-between sourceHousing_fd1_0_c1' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/fafangyuan/publishrequestHousing/publishrequestHousing?type=4`">
            <view class='flex flex-wrap align-center'>
              <image class='sourceHousing_fd1_0_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"47.png"'></image>
              <view class='flex flex-direction flex-wrap align-start'>
                <text class='sourceHousing_fd1_0_c0_c0_c1_c0'>{{$t('求房源')}}</text>
                <text class='sourceHousing_fd1_0_c0_c0_c1_c1'>{{$t('需要找房源')}}</text>
              </view>
            </view>
            <image class='sourceHousing_fd1_0_c0_c1' mode="aspectFit" :src='STATIC_URL+"46.png"'></image>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->


    </view>
    <!-- #ifdef H5 -->
    <view class="text-df text-white flex align-center justify-between fixedupload" @click.stop="upLoad">
      <view class="flex align-center">
        <image src="../../../static/logo.png" mode=""></image>
        <view class="">使用 NextRent App 解鎖完整功能 </view>
      </view>
      <view class="text-sm btns">去下載</view>
    </view>
    <!-- #endif -->
  </view>
</template>
<script>
  export default {
    components: {},


    data() {
      return {
        carousel: '',
        href: ''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      this.getbanner()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      uni.setTabBarItem({
        index: 0,
        text: this.$t('首页'),
        iconPath: '/static/tab/tab_diy0.png',
        selectedIconPath: '/static/tab/tab_diy0_active.png'
      })
      uni.setTabBarItem({
        index: 1,
        text: this.$t('求房源'),
        iconPath: '/static/tab/tab_diy1.png',
        selectedIconPath: '/static/tab/tab_diy1_active.png'
      })
      uni.setTabBarItem({
        index: 2,
        text: this.$t('发房源'),
        iconPath: '/static/tab/tab_diy2.png',
        selectedIconPath: '/static/tab/tab_diy2_active.png'
      })
      uni.setTabBarItem({
        index: 3,
        text: this.$t('我的'),
        iconPath: '/static/tab/tab_diy3.png',
        selectedIconPath: '/static/tab/tab_diy3_active.png'
      })
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      upLoad() {
        let platform = uni.getSystemInfoSync().platform
        if (platform == 'ios') {
          window.location.href = "https://apps.apple.com/cn/app/nextrent/id6475764677"
        } else {
          window.location.href = "https://play.google.com/store/apps/details?id=com.xianggangfangyuans.benben&pli=1"
        }
      },
      goUrl() {
        uni.navigateTo({
          url: `/pages/benben-built-in/web-view/web-view?webPath=${this.href}`
        })
      },
      async getbanner() {
        let datacarousel = await this.$api.get(global.apiUrls.post641e624160dd0, {
          type: '3'
        });

        if (datacarousel.data.code != 1) {
          this.$message.info(datacarousel.data.msg);
          return
        }
        let infocarousel = datacarousel.data;
        this.carousel = infocarousel.data[0].thumb
        this.href = infocarousel.data[0].href
      }
    }
  };
</script>
<style lang="scss" scoped>
  .fixedupload {
    width: 100%;
    position: fixed;
    bottom: 100rpx;
    padding: 32rpx 24rpx;
    left: 0;
    text-align: center;
    background-color: #000;
    z-index: 9;
    border-radius: 44rpx 44rpx 0 0;

    image {
      width: 50rpx;
      height: 50rpx;
      border-radius: 16rpx;
      margin-right: 12rpx;
    }

    .btns {
      width: 120rpx;
      height: 60rpx;
      line-height: 60rpx;
      border-radius: 16rpx;
      text-align: center;
      width: #0181ff;
      background-color: #0181ff;
    }
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(248, 248, 248, 1);
    background-size: 100% auto;
  }

  .sourceHousing_flex_0 {
    position: relative;
  }

  .sourceHousing_fd0_1_c0 {
    font-size: 33rpx;
    color: rgba(9, 36, 75, 1);
    font-weight: 600;
  }

  .sourceHousing_fd0_1 {
    position: absolute;
    right: 32rpx;
    top: 80rpx;
  }

  .sourceHousing_fd0_0_c0 {
    width: 750rpx;
    height: 460rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .sourceHousing_flex_1 {
    padding: 0rpx 24rpx 0rpx 24rpx;
    margin: -33rpx 0rpx 0rpx 0rpx;
  }

  .sourceHousing_fd1_0_c1 {
    background: rgba(246, 247, 249, 1);
    border-radius: 16rpx;
    background-size: 100% auto;
    padding: 38rpx 28rpx 38rpx 32rpx;
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .sourceHousing_fd1_0_c0_c1 {
    width: 33rpx;
    height: 33rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .sourceHousing_fd1_0_c0_c0_c1_c1 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .sourceHousing_fd1_0_c0_c0_c1_c0 {
    color: #000000;
    font-size: 32rpx;
    font-weight: 500;
    line-height: 42rpx;
  }

  .sourceHousing_fd1_0_c0_c0_c0 {
    width: 94rpx;
    height: 94rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .sourceHousing_fd1_0_c0 {
    background: rgba(246, 247, 249, 1);
    border-radius: 16rpx;
    background-size: 100% auto;
    padding: 38rpx 28rpx 38rpx 32rpx;
  }

  .sourceHousing_fd1_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 16rpx;
    background-size: 100% auto;
    padding: 32rpx 24rpx 32rpx 24rpx;
    position: relative;
  }
</style>
